<template>
	<el-form class="roleEditForm" ref="roleInfo" :inline="true" :model="roleInfo" label-width="80px">
		<el-form-item label="角色编号">
			<el-input v-model="roleInfo.roleCode"></el-input>
		</el-form-item>
		<el-form-item label="角色名称">
			<el-input v-model="roleInfo.roleName"></el-input>
		</el-form-item>
		<el-form-item label="角色数据类型">
			<el-select v-model="roleInfo.roleDataType" multiple placeholder="请选择">
				<el-option v-for="item in options.roleDataType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
				</el-option>
			</el-select>
		</el-form-item>
	</el-form>
</template>
<script>
	import request from '@/utils/request'
	export default {
		name: 'roleEdit',
		props: ['roleInfo'],
		data() {
			return {
				//所有的下拉选项
				options: {
					roleDataType: [],
				}
			}
		},
		watch: {
			roleInfo: function(val) {

			}
		},
		//页面初始化加载
		created() {
			this.getRoleDataType();
		},
		methods: {
			getRoleDataType() {
				request({
					url: '/system/dict/query',
					method: 'post',
					data: {
						dictGroupKey: "DataPermission"
					}
				}).then(response => {
					this.options["roleDataType"] = response.data.list;
				})
			},
		}
	}
</script>
<style>
	.roleEditForm .el-form-item {
		width: 45%;
	}

	.roleEditForm .el-input {
		width: 100%;
	}
</style>
